Pulse width modulation systems are commonly used in a wide variety of different applications, including wave generation, motor control, and anti-lock braking systems. A typical pulse width modulation system produces a variable duty cycle at a fixed frequency. With respect to an ideal pulse train of rectangular pulses, the duty cycle is the ratio of the pulse duration to the pulse period. In many approaches, the duty cycle is specified by a digital input code, and the pulse width modulation system generates a train of pulses of fixed frequency with a width proportional to the value of the digital input code.
Typical pulse width modulation systems are implemented by at least one counter, at least one magnitude comparator, and a high frequency clock. In some of these implementations, a comparator generates a pulse width modulation output based on a comparison between a reference count generated from a duty cycle input code and a clock count generated from a clock signal. A clock divider may be used to generate the clock signal from a high-speed clock signal. The divide-by parameter of the clock divider may be varied to change the frequency of the pulse width modulation signal. The operating frequencies of these types of pulse width modulation systems often are limited by the delays inherent in the counters and the magnitude comparators. In addition, propagation delays often make these designs highly sensitive to fabrication variations, reducing the manufacturability of these types of pulse width modulation systems.
In one aspect of the invention, a pulse width modulation system includes a register and a code word generator. The code word generator has an input for receiving a specified output frequency and a specified duty cycle and is operable to generate code words of different lengths. The code word generator is operable to generate a base code word having a length set to achieve the specified output frequency and having a thermometer code value set in accordance with the specified duty cycle. The code word generator is further operable to load the register with a code word pattern including a sequence of one or more copies of the base code word.
In another aspect, the invention features a pulse width modulation method in accordance with which a specified output frequency and a specified duty cycle are received. The specified output frequency is selected from a set of multiple available output frequencies and the specified duty cycle is selected from a set of multiple available duty cycles. In response to the specified output frequency and the specified duty cycle, a base code word is generated. The base code word has a length set to achieve the specified output frequency and has a thermometer code value set in accordance with the specified duty cycle. A code word pattern that includes a sequence of one or more copies of the base code word is generated.
Other features and advantages of the invention will become apparent from the following description, including the drawings and the claims.